clc
clear;
close all;

offset = 0.2;
a = 0 + offset;
b = 3*pi + offset;

exact = quad(@sin, a, b, 1e-9);

precision = 1e-3;
integ = quad(@sin, a, b, precision)
abs((integ)/exact) - 1

n = 50;
x = (a:b/n:b-b/n)';
integ = trapz(x, sin(x))
abs((integ)/exact) - 1

integ = quad_gauss(@sin, a, b, 0.7*(b-a), 4)
abs((integ)/exact) - 1

clear integ
